import Live from '@/components/live/live.vue'
import LiveHuman from '@/views/test/humanvideo.vue'
import { createRouter, createWebHashHistory } from 'vue-router'

const routes = [
  {  
    path: '/',  
    redirect: '/front', // 重定向到不带斜杠的home  
  },
  {
    path: '/live',
    name: 'live',
    component: Live,
  },
  {
    path: '/livehuman',
    component: () => import('@/views/Back'),
    children: [
      {
        path: '',
        component: LiveHuman
      }
    ]
  },
  {  
    path: '/front', // 主路由路径不带斜杠  
    component: () => import('@/views/Back'),  
    children: [  
      {  
        path: '', // 子路由路径是相对于父路由的，不带斜杠  
        component: () => import('@/views/Front'),
        children: [
          {
            path: '',
            component: () => import('@/views/Footer')
          }
        ]
      }
    ]  
  },
  {  
    path: '/home', // 主路由路径不带斜杠  
    component: () => import('@/views/Back'),  
    children: [  
      {  
        path: '', // 子路由路径是相对于父路由的，不带斜杠  
        component: () => import('@/views/Home'),
        children: [
          {
            path: '',
            component: () => import('@/views/Footer')
          }
        ]
      }
    ]  
  },
  {  
    path: '/recognize', // 主路由路径不带斜杠  
    component: () => import('@/views/Back'),  
    children: [  
      {  
        path: '', // 子路由路径是相对于父路由的，不带斜杠  
        component: () => import('@/views/Recognize'),
        children: [
          {
            path: '',
            component: () => import('@/views/Footer')
          }
        ]
      }
    ]  
  },
  {  
    path: '/collection', // 主路由路径不带斜杠  
    component: () => import('@/views/Back'),  
    children: [  
      {  
        path: '', // 子路由路径是相对于父路由的，不带斜杠  
        component: () => import('@/views/Collection'),
        children: [
          {
            path: '',
            component: () => import('@/views/Footer')
          }
        ]
      }
    ]  
  },
  {  
    path: '/service', // 主路由路径不带斜杠  
    component: () => import('@/views/Back'),  
    children: [  
      {  
        path: '', // 子路由路径是相对于父路由的，不带斜杠  
        component: () => import('@/views/Service'),
        children: [
          {
            path: '',
            component: () => import('@/views/Footer')
          }
        ]
      }
    ]  
  },
  {  
    path: '/analyse', // 主路由路径不带斜杠  
    component: () => import('@/views/Back'),  
    children: [  
      {  
        path: '', // 子路由路径是相对于父路由的，不带斜杠  
        component: () => import('@/views/Analyse'),
        children: [
          {
            path: '',
            component: () => import('@/views/Footer')
          }
        ]
      }
    ]  
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
